package edu.whut.mall.${Module}.service.impl;

import com.github.pagehelper.PageHelper;
import edu.whut.mall.common.api.CommonPage;
import edu.whut.mall.mapper.${ClassName}Mapper;
import edu.whut.mall.model.${ClassName};
import edu.whut.mall.model.${ClassName}Example;
import edu.whut.mall.${Module}.service.I${ClassName}Service;
import edu.whut.mall.${Module}.domain.${ClassName}Params;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;
<#list typeSet as type>
<#if type=='Date'>
import java.util.Date;
    </#if>
</#list>

/**
* @program: d9lab-mall
* @description: ${myComment} Service实现
* @author ${author}
* @date ${date}
*/

@Service
@RequiredArgsConstructor
public class ${ClassName}ServiceImpl implements I${ClassName}Service {


private final ${ClassName}Mapper ${className}Mapper;


    @Override
    public Integer insertOne${ClassName}(${ClassName}Params ${className}Params) {
        ${ClassName} ${className} = new ${ClassName}();
        BeanUtils.copyProperties(${className}Params, ${className});
        return ${className}Mapper.insertSelective(${className});
    }

    @Override
    public Integer updateOne${ClassName}(${ClassName}Params ${className}Params) {
        ${ClassName} ${className} = new ${ClassName}();
        BeanUtils.copyProperties(${className}Params, ${className});
        return ${className}Mapper.updateByPrimaryKeySelective(${className});
    }
}



